Gaussian Elimination

Introduction

Gaussian elimination is a systematic method for solving systems of linear equations.
Because you already know what a system of equations is, our goal here is to show you how to turn any system into a simpler one that is easy to solve.

Gaussian elimination works by transforming a system step-by-step until the answer becomes obvious.

Why Gaussian Elimination Works

These operations are called row operations, and they preserve the solution set.

The Algorithm Step-by-Step

Here is the standard procedure:

1. Write the augmented matrix

For a system like
$2x + y = 5$
$x - y = 1$
we write $$\left[ \begin{array}{cc|c} 2 & 1 & 5 \\\\ 1 & -1 & 1 \end{array} \right]$$

2. Create a leading 1 in the first row

3. Use the leading 1 to eliminate entries below it

4. Move to the next row and repeat

5. Continue until the matrix is in row-echelon form

Row-echelon form looks like:

6. Back-substitute

Once the matrix is simple enough, convert it back into equations and solve from bottom to top.

A Fully Worked Example

Solve the system: $$\begin{aligned} x + y + z &= 6 \\\\ 2x - y + 3z &= 14 \\\\ - x + 2y - z &= -2 \end{aligned}$$

Step 1: Augmented matrix

$$\left[ \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\\\ 2 & -1 & 3 & 14 \\\\ -1 & 2 & -1 & -2 \end{array} \right]$$

Step 2: Eliminate below the first row

Result: $$\left[ \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\\\ 0 & -3 & 1 & 2 \\\\ 0 & 3 & 0 & 4 \end{array} \right]$$

Step 3: Create a leading 1 in Row2

Divide Row2 by $-3$: $$\left[ \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\\\ 0 & 1 & -\tfrac{1}{3} & -\tfrac{2}{3} \\\\ 0 & 3 & 0 & 4 \end{array} \right]$$

Step 4: Eliminate below Row2

Row3 → Row3 − 3·Row2: $$\left[ \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\\\ 0 & 1 & -\tfrac{1}{3} & -\tfrac{2}{3} \\\\ 0 & 0 & 1 & 6 \end{array} \right]$$

Step 5: Back-substitute

From Row3: $z = 6$

From Row2:

From Row1:

Solution

$$(x, y, z) = \left(-\tfrac{4}{3},\ \tfrac{4}{3},\ 6\right)$$

Common Pitfalls

Exercises

  1. Solve the system using Gaussian elimination:
    $x + y = 5$
    $2x - y = 1$

    Solution

    Solving:
    $x + y = 5$
    $2x - y = 1$
    Add the equations: $3x = 6$ → $x = 2$
    Then $y = 3$
    Solution: $(2,3)$

  2. Put the following system into an augmented matrix:
    $3x - y + 2z = 7$
    $x + 4y - z = 1$

    Solution

    Augmented matrix: $$\left[ \begin{array}{ccc|c} 3 & -1 & 2 & 7 \\\\ 1 & 4 & -1 & 1 \end{array} \right]$$

  3. Perform the row operation: Row2 → Row2 − 3·Row1 on $$\left[ \begin{array}{cc|c} 1 & 2 & 4 \\\\ 3 & -1 & 5 \end{array} \right]$$

    Solution

    Row2 − 3·Row1 gives: $$\left[ \begin{array}{cc|c} 1 & 2 & 4 \\\\ 0 & -7 & -7 \end{array} \right]$$

  4. Solve the system:
    $x + 2y + z = 4$
    $2x + y - z = 1$
    $3x + 3y + z = 7$

    Solution

    After elimination, the solution is: $$(x, y, z) = (1, 1, 1)$$

  5. True or false: Row operations can change the solution to a system.

    Solution

    False.
    Row operations never change the solution set.

  6. Convert the matrix to row-echelon form: $$\left[ \begin{array}{cc|c} 2 & 4 & 6 \\\\ 1 & 3 & 5 \end{array} \right]$$

    Solution

    Swap rows to get a leading 1: $$\left[ \begin{array}{cc|c} 1 & 3 & 5 \\\\ 2 & 4 & 6 \end{array} \right]$$ Then Row2 → Row2 − 2·Row1: $$\left[ \begin{array}{cc|c} 1 & 3 & 5 \\\\ 0 & -2 & -4 \end{array} \right]$$ This is row-echelon form.